package Thread;

import java.util.Random;

public class ThreadExam2 {
	public static int num = 0;
	public static void main(String[] args) {
		new Thread(new first()).start();
		new Thread(new second()).start();
		new Thread(new third()).start();

	}

}
class first implements Runnable{
	Random random = new Random();
	@Override
	public void run() {
		while(true){
			ThreadExam2.num++;
			if(ThreadExam2.num> 99) break;
			
			System.out.print("*");
			try {
				Thread.sleep((random.nextInt(91)+10));
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			
		}
	}
	
}
class second implements Runnable{
	Random random = new Random();
	@Override
	public void run() {
		while(true){
			ThreadExam2.num++;
			if(ThreadExam2.num> 99) break;
			
			System.out.print("#");
			try {
				Thread.sleep((random.nextInt(91)+10));
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}
	
}
class third implements Runnable{
	Random random = new Random();
	@Override
	public void run() {
		while(true){
			ThreadExam2.num++;
			if(ThreadExam2.num> 99) break;
			
			System.out.print("#");
			try {
				Thread.sleep((random.nextInt(91)+10));
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}
	
}
